import java.io.InputStream;
import java.io.OutputStream;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Formatter;

public class Main {

	public static Vigenere t = new Vigenere("Imane");
	public static Caesar c = new Caesar("Imane");
	public static PixelChanger pc = new PixelChanger("C:/pok.png",
			"C:/enc.png",
			new String[] { "0x4b18e7b", "0x654cf37", "0x325632ca" });

	public static void main(String[] args) {
		String s = "Marco";
		String[] keys = new String[s.length()];

		for (int i = 0; i < s.length(); ++i) {
			char c = s.charAt(i);
			int j = (int) c;
			int a = (int) Math.pow(Math.E * 2, Math.sqrt(j * Math.PI / Math.E));
			
			keys[i] = Integer.toHexString(a);			
			System.out.println(keys[i]);
		}

		PixelChanger pc = new PixelChanger("C:/pok.png", "C:/enc.png", keys);
		pc.encrypt();
		PixelChanger pcd = new PixelChanger("C:/enc.png", "C:/dec.png", keys);
		pcd.decrypt();
	}

	static byte[] buf = new byte[1024];

	public static void encrypt(InputStream in, OutputStream out) {
		try {
			// Bytes written to out will be encrypted
			// out = new OutputStream(out, ecipher);

			// Read in the cleartext bytes and write to out to encrypt
			int numRead = 0;
			while ((numRead = in.read(buf)) >= 0) {
				out.write(buf, 0, numRead);
			}
			out.close();
		} catch (java.io.IOException e) {
		}
	}

	public static void binary2() {
		String s = "The quick brown fox jumps over the lazy dog";
		StringBuilder binary = new StringBuilder();
		for (int i = 0; i < s.length(); i++) {
			int x = (int) s.charAt(i);
			binary.append(Integer.toBinaryString(x));
			binary.append(' ');
		}
		System.out.println(binary);
	}

	public static void binary1() {
		String s = "Mourad";
		byte[] bytes = s.getBytes();
		StringBuilder binary = new StringBuilder();
		for (byte b : bytes) {
			int val = b;
			for (int i = 0; i < 8; i++) {
				binary.append((val & 128) == 0 ? 0 : 1);
				val <<= 1;
			}
			binary.append(' ');
		}

		System.out.println("'" + s + "' to binary: " + binary);
	}

}